<?php
define('PAGE_ID', 1);require_once 'init.php';require_once 'cf/utils.inc';
$clients = query2arrays("	SELECT 		IFNULL(clients.code, clients.id) AS id,		clients.name, 		clients.logo	FROM clients_on_main	INNER JOIN clients ON clients_on_main.client=clients.id	ORDER BY clients_on_main.sort_order, clients.sort_order");$smarty->assign('clients',$clients);
$projects = query2arrays("	SELECT 		IFNULL(project_categories.code,project_categories.id) as cat_id, 		project_categories.name as cat_name,		project_categories.icon as cat_icon,		IFNULL(projects.code,projects.id) AS id,		projects.name, 		YEAR(projects.dt) as date_year, 		MONTH(projects.dt) as date_month, 		projects.summary, 		projects.banner	FROM projects_on_main	INNER JOIN projects ON projects_on_main.project=projects.id	INNER JOIN project_categories ON projects.category=project_categories.id	ORDER BY projects_on_main.sort_order, projects.sort_order");
for ($i=0; $i<count($projects); ++$i){	$projects[$i]['date_month'] = getMonthName($projects[$i]['date_month']);}$smarty->assign('projects',$projects);
$smarty->display('index.tpl');
?>